package com.hc;



import com.hc.config.RibbonConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients(basePackages = "com.hc.Feign")
@RibbonClient(name = "app-hwx-member",configuration = RibbonConfig.class)
public class MemberConsumerApplication {

    @Bean
    @LoadBalanced //注册中心则必须要开启负载均衡 此注解 //默认是轮询机制
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

    public static void main(String[] args) {
        SpringApplication.run(MemberConsumerApplication.class, args);
    }

}
